<?php echo $this->Session->flash(); ?>
<div id="loading" style="display: none;">
    <?php echo $html->image('loading.gif', array('border' => "0", 'align' => 'center')); ?>
</div>

<table border="1" width="100%">
    <thead>
        <tr>
            <th><h1>CARTA DE SUBSANACION DE  PROYECTO <?php echo $cod ?> </h1></th>
</tr>
</thead>
<tbody>

</tbody>
</table>

<table id="tabla" class="tabla"  >
    <thead>
        <tr>
            <th>FECHA ENVIO </th>
            <th>FECHA RECEPCION</th>
            <th>NUMERO RADICADO SALIDA</th>
            <th>NUMERO RADICADO ENTRADA</th>
            <th>OBSERVACIONES</th>
            <th colspan="3">Opciones</th>
        </tr>
    <tbody>
        <?php foreach ($cartas as $car): ?>

            <tr>
                <td><?php echo $car ['fecha_envio'] ?></td>
                <td><?php echo $car['fecha_recepcion'] ?></td>
                <td><?php echo $car['nro_radicado_salida'] ?></td>
                <td><?php echo $car['nro_radicado_entrada'] ?></td>
                <td><?php echo $car['observaciones'] ?></td>
                <td><?php echo $ajax->link("Editar", array('controller' => 'CorrectionLetters', "action" => "edit", $car['id']), array('update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading')) ?></td>
                <td></td>
                <td></td>

            </tr>
        <?php endforeach; ?>
    </tbody>
</table>
<br>
<br>
<br>
<?php if (empty($cartas))
    echo $ajax->link("ADICIONAR REGISTRO", array('controller' => 'CorrectionLetters', "action" => "add",$claim_id), array('update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading')) ?>
<br>

<?php if (!empty($cartas)): ?>

    <table border="1" width="100%">
        <thead>
            <tr>
                <th><h1>SUBSANACIONES EXISTENTES DE  PROYECTO <?php echo $cod ?> </h1></th>
    </tr>
    </thead>
    <tbody>

    </tbody>
    </table>

    <table id="tabla" class="tabla"  >
        <thead>
            <tr>
                <th>ID </th>
                <th>TEXTO</th>
                <th>Estado</th>
                <th colspan="3">Opciones</th>
            </tr>
        <tbody>
            <?php foreach ($requisitos as $rec): ?>
                <?php
                $re = "Sin Registro";

                switch ($rec['ProyectRequirement']['cal_subsanacion']) {
                    case 0:
                        $re = "Sin Registro";
                        break;
                    case 1:
                        $re = "Subsanó Cumple";
                        break;
                    case 2:
                        $re = "Subsanó No Cumple";
                        break;
                    case 3:
                        $re = "No Subsanó";
                        break;

                    default:
                        $re = "";
                        break;
                }
                ?>
                <tr>
                    <td><?php echo $rec['ProyectRequirement']['id'] ?></td>
                    <td><?php echo $rec['Requirement']['texto'] ?></td>
                    <td><?php echo $re ?></td>
                    <td><?php echo $ajax->link("Ver concepto", array('controller' => 'ProyectRequirements', "action" => "edit_correction", $rec['ProyectRequirement']['id']), array('update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading')) ?></td>
                    <td></td>
                    <td></td>

                </tr>
            <?php endforeach; ?>
        </tbody>
    </table>



    <?php $session->flash(); ?>
    <div id="loading0" style="display: none;">
        <?php echo $html->image('loading.gif', array('border' => "0", 'align' => 'center')); ?>
    </div>
    <table border="1" width="100%">
        <thead>
            <tr>
                <th align="center"><h1>SUBSANACIONES ASPIRANTES  <? echo $cod ?></h1></th>
    </tr>
    </thead>
    <tbody>

    </tbody>
    </table>
    <table id="tabla" class="tabla"  >
        <thead>
            <tr>
                <th>ID </th>
                <th>DOCUMENTO </th>
                <th>NOMBRE</th>
                <th>TEXTO</th>
                <th>Estado</th>
                <th colspan="3">Opciones</th>
            </tr>
        <tbody>
            <?php foreach ($requisitos1 as $rec): ?>
                <?php
                $re = "Sin Registro";

                switch ($rec['CandidateRequirement']['cal_subsanacion']) {
                    case 0:
                        $re = "Sin Registro";
                        break;
                    case 1:
                        $re = "Subsanó Cumple";
                        break;
                    case 2:
                        $re = "Subsanó No Cumple";
                        break;
                    case 3:
                        $re = "No Subsanó";
                        break;

                    default:
                        $re = "";
                        break;
                }
                ?>
                <tr>
                    <td><?php echo $rec['CandidateRequirement']['id'] ?></td>
                    <td><?php echo $rec['Candidate']['nro_ident'] ?></td>
                    <td><?php echo $rec['Candidate']['1er_nombre'] . " " . $rec['Candidate']['1er_apellido'] ?></td>
                    <td><?php echo $rec['Requirement']['texto']; ?></td>
                    <td><?php echo $re ?></td>
                    <td><?php echo $ajax->link("Ver concepto", array('controller' => 'CandidateRequirements', "action" => "edit_correction", $rec['CandidateRequirement']['id']), array('update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading0')) ?></td>
                    <td></td>
                    <td></td>

                </tr>
            <?php endforeach; ?>
        </tbody>
    </table>

    <div id="loading1" style="display: none;">
        <?php echo $html->image('loading.gif', array('border' => "0", 'align' => 'center')); ?>
    </div>

    <table border="1" width="100%">
        <thead>
            <tr>
                <th><h1>SUBSANACIONES PARA PREDIOS: <?php echo $cod ?></h1></th>
    </tr>
    </thead>
    <tbody>

    </tbody>
    </table>
    <table id="tabla" class="tabla"  >
        <thead>
            <tr>
                <th>CODIGO</th>
                <th>TEXTO</th>
                <th>Estado</th>
                <th colspan="3">Opciones</th>
            </tr>
        <tbody>
            <?php foreach ($requisitos2 as $rec): ?>
                <?php
                $re = "Sin Registro";

                switch ($rec['PropertyRequirement']['cal_subsanacion']) {
                    case 0:
                        $re = "Sin Registro";
                        break;
                    case 1:
                        $re = "Subsanó Cumple";
                        break;
                    case 2:
                        $re = "Subsanó No Cumple";
                        break;
                    case 3:
                        $re = "No Subsanó";
                        break;

                    default:
                        $re = "";
                        break;
                }
                ?>
                <tr>
                    <td><?php echo $rec['Property']['codigo'] ?></td>
                    <td><?php echo $rec['Requirement']['texto'] ?></td>
                    <td><?php echo $re ?></td>
                    <td><?php echo $ajax->link("Ver concepto", array('controller' => 'PropertyRequirements', "action" => "edit_correction", $rec['PropertyRequirement']['id']), array('update' => 'content', 'complete' => 'cargar()', 'indicator' => 'loading1')) ?></td>
                    <td></td>
                    <td></td>

                </tr>
            <?php endforeach; ?>
        </tbody>
    </table>

    <?php $session->flash(); ?>
    <h1>ESTUDIOS DE PREDIOS RALIZADOS AL PROYECTO  <?php echo$cod; ?></h1>
    <div id="loading2" style="display: none;">
        <?php echo $html->image('loading.gif', array('border' => "0", 'align' => 'center')); ?>
    </div>
    <table  id="tabla" class="tabla" >
        <thead>
            <tr>
                <th>Id</th>
                <th>Concepto</th>
                <th>Documentos solicitados</th>
                <th colspan="2"></th>

            </tr>
        </thead>
        <tbody>
            <?php foreach ($studies as $prop): ?>
                <tr>
                    <td><?php echo $prop['Property']['codigo'] ?></td>
                    <td><?php echo $prop['TitleStudy']['concepto'] ?></td>
                    <td><?php echo $prop['TitleStudy']['doc_subsanacion'] ?></td>
                    <td colspan="2"><?php ?></td>
                </tr>
            <?php endforeach; ?>
        </tbody>
    </table>
    <br>


    <br>



<?php endif; ?>
        
